
LobbyPanel = {};
local this = LobbyPanel;

local transform;
local gameObject;
local behaviour;

function LobbyPanel.New()
    panelMgr:CreatePanel("Lobby",nil);
end

function LobbyPanel.Awake(obj)
    gameObject=obj;
    transform=obj.transform;
    behaviour = transform:GetComponent('LuaBehaviour');
    
    --按钮绑定
    this.classicBtn=transform:Find("classicBtn").gameObject;--经典模式按钮
    behaviour:AddClick(this.classicBtn,this.OnClassicClick)
end

function LobbyPanel.OnClassicClick()
    --请求匹配游戏
    local data = {mode = 1 };
    local message = protobuf.encode("lin.ReqMatch", data)
    Network.Send(Protocal.ReqMatch,message)
end